package com.hfzy.ihk.web.freeswitchManage.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hfzy.ihk.facade.freeswitchManage.entity.GatewayCardSlotHistory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author czs
 * @since 2019-04-03
 */
public interface GatewayCardSlotHistoryMapper extends BaseMapper<GatewayCardSlotHistory> {

    @Insert("insert into gateway_card_slot_history(gateway_num,channel_index,slot_index,ccid) VALUES(#{sn},#{channel},#{slotId},#{ccid}) ON DUPLICATE KEY UPDATE ccid= VALUES (ccid)")
    void saveOrUpdateGatewayCardSlotHistory(@Param("sn")String sn, @Param("channel")String channel, @Param("slotId")String slotId, @Param("ccid")String ccid);

    @Select("select * from gateway_card_slot_history where gateway_num=#{sn} and channel_index=#{channel} and slot_index=#{slotId}")
    GatewayCardSlotHistory queryGatewayCardSlotHistoryBySlotInfo(@Param("sn")String sn, @Param("channel")String channel, @Param("slotId")String slotId);
}
